import Vue from 'vue';
import VueRouter from 'vue-router'

import Login from '../views/Login.vue'
import Manage from '../views/Manage.vue'
// 引入子路由
import authRouter from './authRouter'


Vue.use(VueRouter);

const router = new VueRouter({
    routes: [
        // 基础路由：不需要登录即可访问
        {
            path: '/login',
            component: Login,
        }, 
        {
            path:'/',
            redirect:'/login'
        },
        {
            path:'/manage',
            component:Manage,
            // 注册子路由
            children:authRouter,
            meta:{
                requiresAuth:true
            }
        }
    ],
})




export default router;
console.log('router',router)